#git clone https://github.com/alibaba/MNN.git
 cd MNN
# export ANDROID_NDK=xxxx #设置NDK目录到ANDROID_NDK

function buildMNN() {
    rm -rf build_${ANDROID_ABI}
    mkdir -p build_${ANDROID_ABI}
    cd build_${ANDROID_ABI}
    cmake .. \
    -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK/build/cmake/android.toolchain.cmake \
    -DCMAKE_BUILD_TYPE=Release \
    -DANDROID_ABI=$ANDROID_ABI \
    -DANDROID_STL=c++_shared \
    -DCMAKE_BUILD_TYPE=Release \
    -DANDROID_NATIVE_API_LEVEL=android-19  \
    -DANDROID_TOOLCHAIN=clang \
    -DMNN_USE_LOGCAT=ON \
    -DMNN_USE_SSE=OFF \
    -DMNN_BUILD_TEST=OFF \
    -DMNN_JNI=ON \
    -DMNN_LOW_MEMORY=ON \
    -DMNN_SEP_BUILD=ON \
    -DMNN_SUPPORT_BF16=ON \
    -DANDROID_ARM_NEON=ON \
    -DMNN_VULKAN=OFF \
    -DMNN_OPENCL=OFF \
    -DMNN_OPENGL=OFF \
    -DMNN_OPENGL_REGEN=OFF \
    -DMNN_BUILD_FOR_ANDROID_COMMAND=ON \
    -DNATIVE_LIBRARY_OUTPUT=lib \
    -DNATIVE_INCLUDE_OUTPUT=include $1 $2 $3 $4 $5 $6 $7 \
    -DCMAKE_INSTALL_PREFIX=install

    make -j10
    make install
    cd ..
}

export ANDROID_ABI=armeabi-v7a
buildMNN
export ANDROID_ABI=arm64-v8a
buildMNN
